﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SecurityTrimmingToolPartControl.ascx.cs" Inherits="SecurityTrimming.WebParts.SecurityTrimming.SecurityTrimmingToolPartControl" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 

<script type="text/javascript" src="<%= ResolveClientUrl("~/_layouts/1033/Scripts/RoketSolutions.SP2010.Infrostructure/yepnope.js") %>"></script>
<script type="text/javascript">
	yepnope({
		test: window.jQuery,
		nope: '<%= ResolveClientUrl("~/_layouts/1033/Scripts/RoketSolutions.SP2010.Infrostructure/jquery-1.7.1.min.js") %>',
		complete: function () {
		    $(function() {
		    	$("div.ms-propGridTable span.wp-title")
    	            .click(function () {
    	            	var controlId = $(this).attr("targetcontrolid");
    	            	var webPart = $("div[webpartid='" + controlId + "']");
    	            	if (webPart) {
    	            		webPart.toggleClass("wp-highlighted");
    	            	}
    	            });
		    });
		}
	});
</script>

<style type="text/css">
	.UserSectionTitle span {padding-left: 10px;}
	.UserControlGroup {margin-left: 4px;}
	.ms-TPSectionTD, .ms-TPBody .ms-propGridTable {padding:0;}
	.wp-title {white-space: nowrap;cursor: pointer;}
	.wp-highlighted {border: 2px dashed red;}
	.people-editor-wrapper .ms-inputuserfield {border: 1px solid silver;}
</style>

<div class=".ms-TPBody">
	<table cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
		<tr>
			<td>
				<div class="UserSectionTitle">
					<span>SecurityTrimming Settings</span>
				</div>
			</td>
		</tr>
	</table>
	<div class="ms-propGridTable">
		<table cellspacing="0" border="0" style="border-width:0px;width:100%;border-collapse:collapse;">
			<tr>
				<td>
					<div class="UserSectionHead">
						<label>Use Trimming Provider WebPart</label>
					</div>
					<div class="UserSectionBody">
						<div class="UserControlGroup">
							<asp:CheckBox runat="server" ID="CheckBoxUseTrimmingProvider" Checked="false" Text="Enabled"/>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="UserDottedLine" style="width:100%"></div>
				</td>
			</tr>
			<asp:Repeater runat="server" ID="RepeaterSettings" OnItemDataBound="OnRepeaterSettingsItemDataBound">
				<ItemTemplate>
					<tr>
						<td>
							<div class="UserSectionHead">
								<label>Control Title:</label>&nbsp;
								<asp:Label runat="server" ID="LabelControlControlId" class="wp-title">
									<b><asp:Literal runat="server" ID="LiteralControlTitle"></asp:Literal></b>
								</asp:Label>
							</div>
							<div class="UserSectionBody">
								<span>Allow:</span>
								<div class="UserControlGroup">
									<SharePoint:PeopleEditor runat="server" ID="PeopleEditorAllowAccounts" CssClass="people-editor-wrapper"  Width="250px" PlaceButtonsUnderEntityEditor="false" AllowTypeIn="true" AllowEmpty="true" MultiSelect="true" SelectionSet="User,SecGroup,SPGroup"/>
								</div>
								<span>Deny:</span>
								<div class="UserControlGroup">
									<SharePoint:PeopleEditor runat="server" ID="PeopleEditorDenyAccounts" CssClass="people-editor-wrapper"  Width="250px" PlaceButtonsUnderEntityEditor="false" AllowTypeIn="true" AllowEmpty="true" MultiSelect="true" SelectionSet="User,SecGroup,SPGroup"/>
								</div>
							</div>
							<asp:HiddenField runat="server" ID="HiddenControlId"/>
						</td>
					</tr>
				</ItemTemplate>
				<SeparatorTemplate>
					<tr>
						<td>
							<div class="UserDottedLine" style="width:100%"></div>
						</td>
					</tr>
				</SeparatorTemplate>
			</asp:Repeater>

			
		</table>
	</div>
</div>
